package com.ssh.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ssh.entity.Product;
import com.ssh.service.ProductService;

@Controller
@RequestMapping("/indexcon")
public class IndexController {

	@Autowired
	private ProductService ps;

	@RequestMapping(value = "/index.do")
	public String index(HttpServletRequest req, HttpServletResponse rsp) {
		
		List<Product> pList = ps.findProduct();
		
		req.setAttribute("pList", pList);
		
		return "index";
	}
}
